Hệ thống quản lý ISP trong PHP
1 <!Doctype html>
2 <html lang="en" class="no-js">
3 <head>
4 <meta charset=" utf-8">
5 <meta name="viewport" content="width=device-width, initial-scale=1">
6 <link href='https://fonts.googleapis.com/css?family=Open+Sans:300,400,700' rel='stylesheet' type='text/css'>
7 <link rel="stylesheet" href="component/css/bootstrap.css"> <!-- CSS bootstrap -->
8 <link rel="stylesheet" href="component/css/bootstrap-select.min.css"> <!-- CSS bootstrap -->
9 <link rel="stylesheet" href="component/css/style.css"> <!-- Resource style -->
10 <link rel="stylesheet" href="component/css/reset.css"> <!-- Resource style -->
11 <link rel="stylesheet" href="component/css/invoice.css"> <!-- CSS bootstrap -->
12 <script src="component/js/modernizr.js"></script> <!-- Modernizr -->
13 <title>Invoice | Netway</title>
14 </head>
15 <body>
16 <div class="container">
17 <?php
18 require_once "includes/headx.php";
19 if (!isset($_SESSION['admin_session']) )
20 {
21 $commons->redirectTo(SITE_PATH.'login.php');
22 }
23 require_once "includes/classes/admin-class.php";
24 $admins = new Admins($dbh);
25
26 if (isset($_POST['customer'])){
27 $customer_id = $_POST['customer'];
28 $bill_id = $_POST['bills'];
29 $bill_months = htmlspecialchars(implode($_POST['months'],','));
30 $discount = $_POST['discount'];
31 $bill_amount = $_POST['total'];
32 if(!empty($discount)){$bill_amount = $_POST['total']-$discount;}
33 $admins->billPay( $customer_id, $bill_id, $bill_months, $discount, $bill_amount );
34
35 $info = $admins->getCustomerInfo($customer_id);
36 if (isset($info) && sizeof($info) > 0) {
37 $package_id = $info->package_id;
38 $packageInfo = $admins->getPackageInfo($package_id);
39 ?>
40 <div class="row">
41 <div class="brand"><img src="component/img/logo.png" alt=""></div>
42 <div class="pull-right">Date: <?=date("jS F y")?></div><br>
43 <div class="em"><b>Name : </b> <em><?=$info->full_name?></em></div>
44 <div class="em"><b>Address:</b> <em><?=$info->address ?></em></div>
45 <div class="em"><b>Contact :</b> <em><?=$info->contact ?></em> </div>
46 <div class="em"><b>Package:</b> <em><?=$packageInfo->name?></em> </div>
47 <div class="em"><b>IP address:</b> <em><?=$info->ip_address?></em></div>
48 </div>
49 <?php } ?>
50 <div class="row">
51 <table class="table table-striped table-bordered">
52 <thead class="thead-inverse">
53 <tr>
54 <th>Payment ID </th>
55 <th>Bills</th>
56 <th>Months</th>
57 <th>Amount</th>
58 </tr>
59 </thead>
60 <tbody>
61 <?php
62 $bills = $admins->fetchPaymentSlip($customer_id);
63 if (isset($bills) && sizeof($bills) > 0){
64 ?>
65 <tr>
66 <td><?=$bills->id?></td>
67 <td><?=$bills->bill_id?></td>
68 <td><?=$bills->bill_month?></td>
69 <td><?=$bills->bill_amount?></td>
70 </tr>
71 </tbody>
72 <tfoot>
73 <tr>
74 <th>In Words</td>
75 <th colspan="3"><?=getToText($bills->bill_amount)?> Only.</th>
76 </tr>
77 </tfoot>
78 <?php
79 } ?>
80 </table>
81 </div>
82 <div class="printbutton hide-on-small-only pull-left"><a href="#" onClick="javascript:window.print()">Print</a></div>
83 <div class="sign pull-right">Authorized Signature</div>
84 <?php
85 } else{
86 echo "<h1>ERROR 404 !!</h1>";
87 } ?>
88 </div>
89
90 </body>
91 <?php include 'includes/footer.php'; ?>